package com.myway.dto.user.domain;

import java.util.HashMap;

/**
 * 
 * @description
 * 
 * IdTypeConstants 证件类型
 * 
 */
public enum IdTypeConstants {
	ID("身份证"), PASSPORT("护照"), OFFICERID("军官证"), OTHER("其它");

	/**
	 *  alias
	 */
	private final String alias;
	private static HashMap<String, IdTypeConstants> map = new HashMap<String, IdTypeConstants>();

	static {
		for (IdTypeConstants e : IdTypeConstants.values()) {
			map.put(e.alias, e);
		}
	}

	/**
	 * @param alias alias
	 */
	IdTypeConstants(String alias) {
		this.alias = alias;
	}

	/**
	 * @return String
	 */
	@Override
	public String toString() {
		return this.alias;

	}

	/**
	 * Return a <code>IdTypeConstants</code> object holding the value of specified alias name
	 * @param alias the alias name of the type
	 * @return a <code>AgentTypeEnum</code> object holding the value represented by the alias name argument
	 */
	public static IdTypeConstants valueOfAlias(String alias) {
		IdTypeConstants type = map.get(alias);

		if (type == null) {
			throw new IllegalArgumentException(
					"Unknown Agent type enum alias [" + alias + "]");
		}

		return type;
	}
}
